package design2.prototype.example.cloneable;

import java.util.Objects;

public class User implements Cloneable{

	private String  name;

	private String age;

	private  String address;

	public User(String name, String age, String address) {
		this.name = name;
		this.age = age;
		this.address = address;
	}

	public User() {
	}


	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAge() {
		return age;
	}

	public void setAge(String age) {
		this.age = age;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		User user = (User) o;
		return Objects.equals(name, user.name) &&
				Objects.equals(age, user.age) &&
				Objects.equals(address, user.address);
	}

	@Override
	public int hashCode() {
		return Objects.hash(name, age, address);
	}

	@Override
	protected Object clone() throws CloneNotSupportedException {
		return super.clone();
	}

	@Override
	public String toString() {
		return "User{" +
				"name='" + name + '\'' +
				", age='" + age + '\'' +
				", address='" + address + '\'' +
				'}';
	}
}

